Ext.define('wmf.model.channel.channel', {
    extend: 'Ext.data.Model',
    fields: [
        { name: 'id', type: 'string' },
        { name: 'channelName', type: 'string' },
        { name: 'status', type: 'string' },
        { name: 'capName', type: 'string' },
        { name: 'capClassname', type: 'string' },
        { name: 'capAClass', type: 'string' },
        { name: 'capFlowName', type: 'string' },
        { name: 'capBusiness', type: 'string' },
        { name: 'capReverse', type: 'string' },
        { name: 'capReverseName', type: 'string' },
        { name: 'flowControl', type: 'string' },
        { name: 'capStart', type: 'string' },
        { name: 'cmccChannelId', type: 'string' ,convert: function(v, record){
			var data = record.data;
			if(!data.id){
				return '空';
			}
			if(data.carrier == '1' && data.status == '1'){
				return data.channelName + '[' + data.id + ']';
			}
        }},
        { name: 'unicomChannelId', type: 'string' ,convert: function(v, record){
			var data = record.data;
			if(!data.id){
				return '空';
			}
			if(data.carrier == '2' && data.status == '1'){
				return data.channelName + '[' + data.id + ']';
			}
			return null;
        }},
        { name: 'telcomChannelId', type: 'string' ,convert: function(v, record){
			var data = record.data;
			if(!data.id){
				return '空';
			}
			if(data.carrier == '3' && data.status == '1'){
				return data.channelName + '[' + data.id + ']';
			}
        }},
        { name: 'carrier', type: 'string' },
        { name: 'carrier1', type: 'string' ,convert: function(v, record){
			var value = record.data.carrier;
			if(value == "1"){
				return "移动";
			}else if(value == "2"){
				return "联通";
			}else if(value == "3"){
				return "电信";
			}else{
				return value;
			}
        }},
        { name: 'channelType', type: 'string' },
        { name: 'channelType1', type: 'string' ,convert: function(v, record){
			var value = record.data.channelType;
			if(value == "1"){
				return "彩信";
			}else if(value == "2"){
				return "短信";
			}else{
				return value;
			}
        }},
        { name: 'protocalType', type: 'string' },
        { name: 'billingType', type: 'string' },
        { name: 'billingType1', type: 'string' ,convert: function(v, record){
			var value = record.data.billingType;
			if(value == "1"){
				return "包月";
			}else if(value == "2"){
				return "包条";
			}else if(value == "3"){
				return "包年";
			}else{
				return value;
			}
        }},
        { name: 'channelPrice', type: 'string' },
        { name: 'needSharing', type: 'string' },
        { name: 'needSharing1', type: 'string' ,convert: function(v, record){
			var value = record.data.needSharing;
			if(value == "0"){
				return "否";
			}else if(value == "1"){
				return "是";
			}else{
				return value;
			}
        }},
        { name: 'sharingRate', type: 'string' },
        { name: 'latestOperator', type: 'string' },
        { name: 'latestOperateTime1', type: 'string' ,convert: function(v, record){
			return wmf.data.mydateformat(record.data.latestOperateTime);
        }},
        { name: 'latestOperateTime', type: 'string' }
    ]
});